@extends("layouts.admin")

@section("_js")
<script>
$(function(){
    $(".to_page").click(function(){
        var href = $(this).attr("href");
        location.href = href;
    });
});
</script>
@endsection

@section("main_content")
    <div class="row">
        <div class="col-sm-12">
            <section class="panel">
        <header class="panel-heading">
            博客列表
        </header>

        <div class="panel-body" style="display: block;">
            <table class="table  table-hover general-table">
                <thead>
                <tr>
                    <th>标题</th>
                    <th class="hidden-phone">概要</th>
                    <th>发布时间</th>
                    <th>作者</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @if($blogList)
                @foreach($blogList as $i)
                    <tr>
                        <td>
                            <a href="#">
                                {{$i->title}}
                            </a>
                        </td>
                        <td class="hidden-phone">{{$i->summary}}</td>
                        <td>{{$i->created_at}}</td>
                        <td><span class="label label-warning label-mini">{{$i->author}}</span></td>
                        <td>
                            <span class="blog_delete to_page btn btn-danger btn-xs" href="/Admin/Blog/delete?id={{$i->id}}">删除</span>
                            <span class="blog_edit to_page btn btn-info btn-xs" href="/Admin/Blog/add?id={{$i->id}}">编辑</span>
                        </td>
                    </tr>
                @endforeach
                @endif
                </tbody>
            </table>
            <div  class="row-fluid">
                <div class="span6">
                    @if($blogList)
                    <div class="dataTables_paginate paging_bootstrap pagination">
                        {!! $blogList->render() !!}
                    </div>
                    @endif
                </div>
            </div>
        </div>
            </section>
        </div>
    </div>
@endsection